const { getBaseList } = require("../service/admin/list");
const { onBaseUpsert } = require("../service/admin/upsert");

const app = require("express").Router();

app.all("/list/:tab", async (req, res) => {
  const data = await getBaseList(req.params.tab, req._body);
  res.send(data);
});

app.all("/upsert/:tab", async (req, res) => {
  const data = await onBaseUpsert(req.params.tab, req._body);
  res.send(data);
});

app.all("/item/:tab/:id", async (req, res) => {
  // res.send(data);
});

module.exports = app;
